<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  bottom.active{
    background-color: #abcdef;
  }
  .content{
    width: 30%;
    height: 30%;
    margin-top: 10px;
  }
</style>
<body>
  <div id="app">
    <button 
      v-for="(nav,index) in arr" 
      :class="{active: num === index}" 
      @click="tab(index)"
      :key="nav.title">
      {{ nav.title }}
    </button>
    <div>
      <img v-for="(nav,index) in arr" :src='nav.pic' v-show="num===index" class="content"></div>
  </div>
</body>
<script src="./vue.js"></script>
<script>
  const vm = new Vue({
    el: '#app',
    data: {
      arr: [
        {
          title:'标题1',
          pic:'https://img.tupianzj.com/uploads/allimg/202012/9999/950b992764.jpg'
        },
        {
          title:'标题2',
          pic:'https://img.tupianzj.com/uploads/allimg/202102/9999/8b45bc942e.jpg'
        },
        {
          title:'标题3',
          pic:'https://img.tupianzj.com/uploads/allimg/202004/9999/bae7f62401.jpg'
        },
        {
          title:'标题4',
          pic:'https://img.tupianzj.com/uploads/allimg/202103/9999/914fab1997.jpg'
        }
      ],
      num: 0
    },
    methods: {
      tab(n){
        this.num = n;
      }
    }
  })
</script>
</html>